package com.itheima.springbootmybatishomework1.mapper;

import com.itheima.springbootmybatishomework1.pojo.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface StudentMapper {
    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into student( name, no, gender, phone, degree, violation_count , violation_score, class_id, create_time, update_time) " +
            "values ( #{name}, #{no}, #{gender}, #{phone}, #{degree}, #{violationCount}, #{violationScore}, #{classId}, #{createTime}, #{updateTime})")
    public void insert(Student student);

    @Select("select * from student where id=#{id}")
    public Student getById(Integer id);

    public  Student list(Integer id);

    public List<Student> cel(String name,Integer id,Integer degree, Integer classId);
    public  void deleteByIds(List<Integer> ids);
}
